<template>
  <div class="payment">
    <h1>缴费页面</h1>
    <el-form ref="paymentForm" :model="paymentForm" @submit.native.prevent="handlePayment">
      <el-form-item label="缴费金额" prop="amount">
        <el-input v-model.number="paymentForm.amount" type="number" placeholder="请输入缴费金额"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handlePayment">支付</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "PaymentForm",
  data() {
    return {
      paymentForm: {
        amount: 0
      }
    };
  },
  methods: {
    handlePayment() {
      console.log('缴费金额:', this.paymentForm.amount);
      alert(`缴费成功: ¥${this.paymentForm.amount}`);
    }
  }
}
</script>

<style scoped>
.payment {
  width: 300px;
  margin: 50px auto;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
</style>
